﻿using EPiServer.Shell.ObjectEditing.EditorDescriptors;

namespace OpenWaves.EPiServer.GeoProperties
{
    [EditorDescriptorRegistration(TargetType = typeof(GeoRectangle), UIHint = PropertyGeoRectangle.UiHint)]
    public class PropertyGeoRectangleEditorDescriptor: PropertyGeoObjectEditorDescriptor
    {
        public PropertyGeoRectangleEditorDescriptor(): base()
        {
            this.ClientEditingClass = "ow-epi-geoProperties.widgets.GeoViewPortSelector";
        }

        public override void ModifyMetadata(global::EPiServer.Shell.ObjectEditing.ExtendedMetadata metadata, System.Collections.Generic.IEnumerable<System.Attribute> attributes)
        {
            base.ModifyMetadata(metadata, attributes);            
            metadata.EditorConfiguration.Add("geoViewPortDialogUrl", this.GetEmbeddedResourceUrl(typeof(ViewPortPage)));   
            //translations
            AddLocalizedValue(metadata, "selectViewPortText", "Click to select a view port");
            AddLocalizedValue(metadata, "clearText", "Clear");
        }

        protected override string PropertyUniqueName
        {
            get { return PropertyGeoRectangle.UniqueName; }
        }
    }
}